package com.guigu.qingcheng.service;

import com.qingcheng.entity.Result;
import com.qingcheng.pojo.user.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(name = "service-user")
public interface UserFeign {

    @GetMapping("/user/sendMsg")
    Result sendMsg(@RequestParam("phone") String phone);

    @PostMapping("/user/register")
    Result save(@RequestBody User user, @RequestParam("smsCode") String smsCode);

    // 登录
    @PostMapping("/user/login")
    public Result loginUser(@RequestBody User user);

    // 获取登录用户信息
    @GetMapping("/user/getUserInfo")
    public Result getUserInfo(@RequestParam String username);
}
